#ifndef RECVFILE_H
#define RECVFILE_H

#include <QObject>
#include <QTcpSocket>
class RecvFile :public QObject
{
    Q_OBJECT
public:
    explicit RecvFile(QObject *parent = nullptr);
    ~RecvFile();

    //连接服务器的函数
    void connectServer(QString ip,unsigned short port);
    void dealData();
signals:
    void connectOK();
    void message(QByteArray msg);
    void gameover();
    void total_size_signal(qint64);
    void now_size_signal(qint64);
public slots:

private:
    QTcpSocket* m_tcp;
    bool first_total = true;  //首次读取文件总大小
    qint64 nowsize =0;
};
#endif // RECVFILE_H
